<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>${_front_title}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/static/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="${_front_css}/main.css">
	<link rel="stylesheet" type="text/css" href="${_front_css}/index.css">
    <link rel="stylesheet" href="${_front_css}/base.css">
    <link rel="stylesheet" href="${_front_css}/account/account.css">
    <link rel="stylesheet" href="${_front_css}/account/account-statistics.css">
    <script type="text/javascript" src="${_front_js}/jquery.min.js"></script>

</head>

<body>
    <!-- 头部 开始 -->
    <div id="header">
		<#include "../base/top.ftl" />
	</div>
	<!-- 头部 结束 -->
    <div class="member">
        <div class="memberLeft">
            <div class="title">我的账户</div>
            <#include "base.ftl" />
        </div>
        <div class="memberRight info">
            <div class="box switching">
                <ul class="tab_menu">
                    <li class="current">资产统计</li>
                </ul>
                <div class="tab_box">
                    <div class="">
                        <div id="data1" style="height:300px; width: 800px; margin: 0 auto;"></div>
                    </div>
                </div>
            </div>
            <div class="detail">
                <div class="title">待收待还详情</div>
                <div class="de-tab">
                    <div class="fl all">
                        <p class="p1">累计净赚收益</p>
                        <p class="p2">
                        	<#if detail?exists & detail.interest?exists>
	                    		￥${detail.interest?string('0.00')}
	                    	<#else>
	                    		￥0.00
	                    	</#if>
						</p>
                        <p class="p3">上月已收本息：￥0</p>
                        <p class="p4">本月待收本息：￥0</p>
                    </div>
                    <div class="fr article">
                        <div class="r-top">
                            <ul>
                                <li>
                                    <p>                            	
	                                    <#if detail?exists & detail.totalTenderMoney?exists>
			                    			￥${detail.totalTenderMoney?string('0.00')}
			                    		<#else>
			                    			￥0.00
			                    		</#if>
		                    		</p>
                                    <p>总投资金额</p>
                                </li>
                                <li>
                                    <p>
			                        	<#if detail?exists & detail.awaitTotal?exists>
				                    		￥${detail.awaitTotal?string('0.00')}
				                    	<#else>
				                    		￥0.00
				                    	</#if>                                    
                                    </p>
                                    <p>待收本息</p>
                                </li>
                                <li>
                                    <p>
			                        	<#if detail?exists & detail.payCount?exists>
				                    		￥${detail.payCount?string('0.00')}
				                    	<#else>
				                    		￥0.00
				                    	</#if>
									</p>
                                    <p>待还本息</p>
                                </li>                                
                                <li>
                                    <p>
		                            	<#if detail?exists & detail.total?exists>
				                    		￥${detail.total?string('0.00')}
				                    	<#else>
				                    		￥0.00
				                    	</#if>
									</p>
                                    <p>已收本息</p>
                                </li>

                            </ul>
                        </div>
                        <div class="r-bottom">
                            <ul>
                                <li>
                                    <p>
		                            	<#if detail?exists & detail.interest?exists>
				                    		￥${detail.interest?string('0.00')}
				                    	<#else>
				                    		￥0.00
				                    	</#if>
		                    		</p>
                                    <p>投资收益</p>
                                </li>
                                <li>
                                    <p>￥0.00</p>
                                    <p>债权收益</p>
                                </li>
                                <li>
                                    <p>
		                            	<#if detail?exists & detail.fund?exists>
				                    		￥${detail.fund?string('0.00')}
				                    	<#else>
				                    		￥0.00
				                    	</#if>
		                    		</p>
                                    <p>已收本金</p>
                                </li>
                                <li>
                                    <p>
		                            	<#if detail?exists & detail.awaitFund?exists>
				                    		￥${detail.awaitFund?string('0.00')}
				                    	<#else>
				                    		￥0.00
				                    	</#if>
		                    		</p>
                                    <p>待收本金</p>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <!-- 底部 开始 -->
	<#include "../base/foot.ftl" />
	<!-- 底部 结束 -->
    <script type="text/javascript" src="${_front_js}/tabs.js"></script>
    <script type="text/javascript" src="${_front_js}/common.js"></script>
    <script type="text/javascript" src="${_front_js}/echarts.js"></script>
    <script type="text/javascript">
 		$(window).load(function() {
      		
      		require.config({
		        paths: {
		            echarts: '/static/front/js'
		        }
		    });      
			$.ajax({
	            type: "GET",
	            url:"/account/fund/info",
	            async: false,
                dataType:'JSON',
	            success: function(result){
	            	if(result.code==-1){
	            		var entity=result.entity;
	            		var num=new Array(entity.balance,entity.freezen,entity.awaitFund,entity.awaitInterest); 

					    require(
					        [
					            'echarts',
					            'echarts/chart/pie'
					        ],
					        function(ec) {
					            var myChart = ec.init(document.getElementById('data1'));
					            myChart.setOption({
					                title: {
					                    text: '资产统计图',
					                    subtext: '',
					                    x: 'center'
					                },
					                tooltip: {
					                    trigger: 'item',
					                    formatter: "{a} <br/>{b} : {c} ({d}%)"
					                },
					                legend: {
					                    orient: 'vertical',
					                    x: 'left',
					                    data: ['可用余额', '冻结余额', '待收本金', '待收利息']
					                },
					                toolbox: {
					                    show: false,
					                    feature: {
					                        mark: {
					                            show: true
					                        },
					                        dataView: {
					                            show: true,
					                            readOnly: false
					                        },
					                        magicType: {
					                            show: true,
					                            type: ['pie', 'funnel'],
					                            option: {
					                                funnel: {
					                                    x: '25%',
					                                    width: '50%',
					                                    funnelAlign: 'left',
					                                    max: 1548
					                                }
					                            }
					                        },
					                        restore: {
					                            show: true
					                        },
					                        saveAsImage: {
					                            show: true
					                        }
					                    }
					                },
					                calculable: true,
					                series: [{
					                    name: '迅泊达',
					                    type: 'pie',
					                    radius: '60%',
					                    center: ['50%', '60%'],
					                    data: [{
					                        value: num[0],
					                        name: '可用余额'
					                    }, {
					                        value: num[1],
					                        name: '冻结余额'
					                    }, {
					                        value: num[2],
					                        name: '待收本金'
					                    }, {
					                        value: num[3],
					                        name: '待收利息'
					                    }]
					                }]
					            });
					
					        }
					    ); 	            		 
	            	}
	            }
	        });  
           
        });   	
    </script>
</body>

</html>
